#ifndef ML_PROGRESSBAR_H
#define ML_PROGRESSBAR_H
#include <vector>
#include <string>

class MLProgressbar {
public:
	MLProgressbar(const size_t total, const char* description);
	void update();

private:
	const char* _description;
	size_t _eta_update_time_us = 0;
	size_t _last_update_time;
	const int _n_records = 32;
	size_t _progress;
	std::vector<size_t> _records;
	size_t _start_time;
	size_t _total;
	std::string _format_time(size_t time_ms);
	void _output();
};
#endif
